Skip to main content

Admin Setup

Automatic

There are two scripts add_user.sh and remove_user.sh inside the /etc/wireguard directory. These scripts are saved in Wireguard Scripts.

To add a new user to wireguard you first need to find an available octet. Run wg show and look for the next availalbe IP address starting with 10.13.115.. For example, if the last peers IP address is 10.13.115.5 and no peer is using the address 10.13.115.6 then the octet/id 6 is available.

Once you find an available octet you can run sudo bash /etc/wireguard/add_user.sh <username> <octet>

Manual

A configuration file wg0.conf needs to be added to the /etc/wireguard directory on your machine. This can be obtained from the admin who granted access.

Add the users public key and the preshared key to the bottom of /etc/wireguard/wg0.conf:

/etc/wireguard/wg0.conf

# USERNAME
[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PresharedKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Address = 10.13.115.X/24

Store your config

/etc/wireguard/configs/USERNAME

[Interface]
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Address = 10.13.115.X/24
DNS = 1.1.1.1, 1.0.0.1

[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PresharedKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Endpoint = 10.13.115.X/24
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25